<template>
  <div class="shopcar-page mx-auto max-w-7xl">
    <div class="page-title lg:!px-0">
      <div class="text flexbox flex-align-center flex-justify-between select-none">
        <h1 class="capitalize">{{ $t('userPanel.shopcarNum') }}</h1>
        <span class="batch capitalize" v-if="tableData.length && isBatch == 0" @click="isBatch = 1">{{ $t('formBtn.batch') }}</span>
        <span class="batch capitalize" v-if="tableData.length && isBatch == 1" @click="isBatch = 0">{{ $t('formBtn.complete') }}</span>
      </div>
    </div>
    <div class="list">
      <el-table
        v-if="tableData.length"
        class="table select-none"
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        width="100%"
        :row-key="row => `${row.id}-${row.sku?.id || 0}-${row.code || ''}`"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" align="center"> </el-table-column>
        <el-table-column :label="$t('formItem.productName')" width="300">
          <template slot-scope="scope">
            <!-- @click="goDetail(scope.row)" -->
            <!--  -->
            <nuxt-link class="goods flex gap-2 items-center" :to="localePath(`/product/${scope.row.code}`)">
              <div class="img overflow-hidden flex-none border">
                <img
                  class="size-full object-cover"
                  v-lazy="$globalFn.imgPrefixUrl(scope.row.image, 'goods_thumb_1_1')"
                  :alt="scope.row.image"
                  loading="lazy"
                  srcset=""
                />
              </div>
              <div class="info flex-1">
                <div class="break-words !w-full hover:underline-offset-2 line-clamp-2 hover:underline cursor-pointer">
                  {{ scope.row.goods_name }}
                </div>
                <div class="desc one-line" v-if="scope.row.sku">
                  {{ scope.row.sku.title }}
                </div>
              </div>
            </nuxt-link>
          </template>
        </el-table-column>
        <el-table-column :label="$t('formItem.productPrice')" align="center">
          <template slot-scope="scope">
            <div class="price flex gap-1 justify-center items-center" v-if="scope.row.status == 1">
              <span> {{ (scope.row.sku && scope.row.sku.currency && scope.row.sku.currency.currency_symbol) || '' }}</span>
              <span>
                {{ scope.row.price }}
              </span>
            </div>
            <span class="disabled" v-else>{{ $t('status.invalidation') }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('formItem.productNum')" align="center">
          <template slot-scope="scope">
            <div class="num-box" v-if="scope.row">
              <LazyInputNumber
                :inputVal="scope.row.sku.buy_num"
                :disabled="scope.row.status != 1"
                :oneClick="oneClick"
                :max="scope.row.sku.stock_num >= 20 ? 20 : scope.row.sku.stock_num"
                @handleChange="val => handleChangeRes(scope.row, val)"
              />
            </div>
          </template>
        </el-table-column>
        <el-table-column :label="$t('formItem.productTotal')" align="center">
          <template slot-scope="scope">
            <div class="total-price flex gap-1 justify-center items-center" v-if="scope.row.status == 1">
              <span>
                {{ (scope.row.sku && scope.row.sku.currency && scope.row.sku.currency.currency_symbol) || '' }}
              </span>
              <span>
                {{ scope.row.totalPrice ? scope.row.totalPrice.toFixed(2) : 0 }}
              </span>
            </div>
            <span class="disabled" v-else>{{ $t('status.invalidation') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="" align="center">
          <template slot-scope="scope">
            <el-button class="delete-btn" type="text" @click="showHandleDelete(scope.row)">{{ $t('formBtn.delete') }}</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="item-box">
        <div class="list-itemss" v-for="item in tableData" :key="item.id">
          <div class="left flexbox flex-align-center">
            <el-checkbox v-model="item.select" @change="selectGoods(item)"></el-checkbox>
            <div class="goods flexbox flex-align-center flex-none" @click="goDetail(item)">
              <img class="img" v-lazy="$globalFn.imgPrefixUrl(item.image, 'goods_thumb_1_1')" :alt="item.image" loading="lazy" srcset="" />
              <div class="info flex-1">
                <div class="name two-line">{{ item.goods_name }}</div>
                <div class="desc one-line" v-if="item.sku">
                  {{ item.sku.title }}
                </div>
                <div class="money">
                  <span class="price" v-if="item.status == 1"
                    >{{ item.sku && item.sku.currency && item.sku.currency.currency_symbol }}{{ item.price }}</span
                  >
                  <span class="disabled" v-else>{{ $t('status.invalidation') }}</span>
                </div>
              </div>
            </div>
            <div class="num-box" v-if="item">
              <LazyInputNumber
                :inputVal="item.num"
                :disabled="item.status != 1"
                :oneClick="oneClick"
                :max="(item.sku && item.sku.stock_num) || 0"
                @handleChange="val => handleChangeRes(item, val)"
              />
            </div>
          </div>
        </div>
      </div>
      <div class="total flexbox flex-align-center flex-justify-end overflow-scroll z-[9999]" v-if="tableData.length">
        <div class="flexbox flex-align-center">
          <div class="all-select flex items-center">
            <el-checkbox v-model="isAllSelect" @change="changeAllSelect">
              {{ $t('formItem.selectAll') }}
            </el-checkbox>
          </div>
          <div class="text flexbox flex-align-center" v-if="isBatch == 0">
            <span class="label">{{ $t('formItem.total') }}：</span>
            <span class="money">{{ userSelect.currency_symbol }} {{ totalPrice ? Number(totalPrice).toFixed(2) : 0 }}</span>
          </div>
        </div>
        <div class="flexbox flex-align-center">
          <el-button
            size="small"
            class="theme-btn capitalize"
            v-if="isBatch == 0"
            :disabled="multipleSelection.length ? false : true"
            :loading="btnLoading"
            @click="createOrder"
            >{{ $t('formBtn.buy') }}<span v-if="multipleSelection.length">({{ multipleSelection.length }})</span></el-button
          >
          <el-button
            size="small"
            class="theme-plain-btn capitalize"
            v-if="isBatch == 1"
            :disabled="multipleSelection.length ? false : true"
            @click="deleteBatchShow"
            >{{ $t('formBtn.delete') }}<span v-if="multipleSelection.length">({{ multipleSelection.length }})</span></el-button
          >
        </div>
      </div>
      <no-data type="shopcar" v-if="tableData.length == 0" :loading="loading"></no-data>
    </div>
    <el-dialog class="confirm-dialog" title="" width="522px" :show-close="false" :close-on-click-modal="false" :visible.sync="showDelete">
      <div class="flexbox flex-tb flex-align-center box-content">
        <div class="title">{{ $t('confirmDialog.removeProduct') }}</div>
        <div class="title-desc">
          {{ $t('confirmDialog.removeProductDesc') }}
        </div>
        <nuxt-link
          class="goods flexbox flex-align-center cursor-pointer"
          v-if="this.multipleSelection.length == 0"
          :to="localePath(`/product/${curRow.code}`)"
        >
          <img loading="lazy" class="img" v-lazy="$globalFn.imgPrefixUrl(curRow.image)" :alt="curRow.image" srcset="" />
          <div class="info">
            <div class="name two-line">{{ curRow.goods_name }}</div>
            <div class="type">{{ curRow?.sku?.title }}</div>
          </div>
        </nuxt-link>
      </div>
      <div class="handle flexbox flex-align-center flex-justify-between">
        <el-button class="btn cancle-btn" @click="cancleBtn">{{ $t('formBtn.cancel') }}</el-button>
        <el-button class="btn delete-btn" :loading="btnLoading" @click="deleteBtn">{{ $t('formBtn.delete') }}</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import { throttle, debounce } from '@/static/js/common'
  export default {
    layout: 'newsHome',
    name: 'shopcar',
    head() {
      return {
        title: 'Cart - SEALMG',
        meta: [
          {
            hid: 'description',
            name: 'description',
            content: 'Review your order and purchase on SEALMG using your preferred payment method.'
          }
        ]
      }
    },
    data() {
      return {
        btnLoading: false, // 按钮加载状态
        isAllSelect: false, // 是否全选
        isBatch: 0, // 批量操作状态 0:正常 1:批量
        loading: false, // 页面加载状态
        tableData: [], // 购物车数据列表
        multipleSelection: [], // 多选选中的数据
        curRow: {}, // 当前操作行数据
        showDelete: false, // 删除确认弹窗显示状态
        userSelect: {}, // 用户选择的配置信息
        oneClick: false, // 防止重复点击
        arr: [] // 数据缓存数组
      }
    },
    computed: {
      // 计算选中商品的总价
      totalPrice() {
        let x = this.multipleSelection.reduce((total, item) => {
          return total + (item.totalPrice || 0)
        }, 0)
        return x ? x : '0.00'
      }
    },
    created() {
      // 获取用户选择的配置信息
      this.userSelect = this.$cookies.get('userSelect') || {}
      this.getShopcarList()
    },
    // 服务端预取购物车数据
    async asyncData({ app }) {
      try {
        const arr = await app.$axios.get(`/api/cart/get`)
        return {
          loading: false,
          tableData: arr || [] // 确保返回数组
        }
      } catch (error) {
        console.error('Failed to fetch cart data:', error)
        return {
          loading: false,
          tableData: []
        }
      }
    },
    methods: {
      changeAllSelect() {
        this.tableData.map(item => {
          item.select = this.isAllSelect
        })
        this.multipleSelection = this.tableData.filter(item1 => item1.select)
      },
      selectGoods(item) {
        let select = item.select
        if (select) {
          this.multipleSelection.push(item)
        } else {
          this.multipleSelection = this.multipleSelection.filter(item1 => item1.id != item.id)
        }
        this.isAllSelect = this.multipleSelection.length == this.tableData.length
      },
      getShopcarList() {
        this.loading = true
        this.$axios
          .get(`/api/cart/get`)
          .then(res => {
            if (res && res.length) {
              res.map(item => {
                item['defualtNum'] = JSON.parse(JSON.stringify(Number(item.sku.buy_num)))
                item['num'] = Number(item.sku.buy_num)
                item['price'] = item.sku.price_text
                item['select'] = false
                item['totalPrice'] = item.sku.buy_num * item.sku.price_text
              })
            }
            this.tableData = res || []
            this.oneClick = false
            this.loading = false
          })
          .catch(err => {
            this.loading = false
            this.tableData = []
          })
      },
      toggleSelection(rows) {
        if (rows) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row)
          })
        } else {
          this.$refs.multipleTable.clearSelection()
        }
      },
      handleSelectionChange(val) {
        this.multipleSelection = val
      },
      addReduceShopCar(row) {
        if (row.num <= 0 || row.sku.stock_num <= 0 || row.defualtNum <= 0) return
        this.$axios
          .post('/api/cart/oper', { gid: row.sku.id, gnum: row.num - row.defualtNum }, { setConfig: { showSuccessMsg: false } })
          .then(async res => {
            this.getShopcarList()
          })
          .catch(err => {
            this.oneClick = false
          })
      },
      handleChangeRes(row, val) {
        this.oneClick = true
        row.num = val
        row.totalPrice = row.price * row.num
        this.addReduceShopCar(row)
      },
      showHandleDelete(row) {
        this.curRow = row
        this.showDelete = true
      },
      cancleBtn() {
        this.showDelete = false
      },
      deleteBatchShow() {
        this.showDelete = true
      },
      deleteBtn: throttle(
        function (type, ids, orderNo) {
          if (this.isBatch == 1) {
            let ids = []
            this.multipleSelection.map(item => {
              ids.push(item.sku.id)
            })
            this.btnLoading = true
            this.$axios
              .post('/api/cart/del', { gid: ids.join(',') }, { setConfig: { showSuccessMsg: true } })
              .then(res => {
                this.btnLoading = false
                this.$store.dispatch('user/getUserInfo')
                this.getShopcarList()
                this.cancleBtn()
              })
              .catch(err => {
                this.btnLoading = false
              })
            return
          }
          if (type != 'all') {
            this.btnLoading = true
          }
          this.$axios
            .post(
              '/api/cart/del',
              { gid: type == 'all' && ids ? ids : this.curRow.sku.id },
              { setConfig: { showSuccessMsg: type == 'all' ? false : true } }
            )
            .then(res => {
              this.btnLoading = false
              this.$store.dispatch('user/getUserInfo')
              if (type == 'all') {
                this.$router.push({
                  path: this.localePath('/order/pay'),
                  query: {
                    no: orderNo
                  }
                })
              } else {
                this.cancleBtn()
                this.getShopcarList()
              }
            })
            .catch(err => {
              this.btnLoading = false
            })
        },
        2000,
        {
          leading: true,
          trailing: false
        }
      ),
      createOrder: throttle(
        function () {
          if (this.multipleSelection.length == 0) {
            this.$message({
              showClose: true,
              message: this.$t('message.selectGoodsWarningText'),
              type: 'warning'
            })
            return
          }
          if (this.multipleSelection.length) {
            let list = []
            let ids = []
            this.multipleSelection.map(item => {
              let obj = { id: item.sku.id, num: item.num, info: {} }
              ids.push(item.sku.id)
              if (item.ext && Array.isArray(item.ext) && item.ext.length) {
                item.ext.map(item1 => {
                  if (item1.field && item1.value) {
                    obj.info[item1.field] = item1.value
                  }
                })
              }
              list.push(obj)
            })
            this.btnLoading = true
            this.$router.push({
              path: this.localePath('/order/cashier'),
              query: {
                data: JSON.stringify(list),
                type: 1
              }
            })
          }
        },
        2000,
        {
          leading: true,
          trailing: false
        }
      ),
      goDetail(item) {
        if (item.type == 1) {
          this.$router.push({
            path: this.localePath(`/cards/${item.code}`)
            // query: { id: item.id },
          })
        } else if (item.type == 2) {
          this.$router.push({
            path: this.localePath(`/game-recharge/${item.code}`)
            // query: { id: item.id },
          })
        }
      }
    }
  }
</script>
<style lang="less" scoped>
  /deep/.el-table__header-wrapper table {
    width: 100% !important;
  }
  /deep/ .el-table::before {
    height: 0px;
  }
  /deep/ .el-table {
    .num-box {
      .count-box {
        margin: 0 auto;
      }
    }
    .el-table__header-wrapper {
      border-radius: 8px 8px 0px 0px;
      .has-gutter {
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        font-size: 14px;
        color: @font-color-66;
      }
    }
    th.el-table__cell {
      background-color: @color-f7;
    }
    td.el-table__cell,
    th.el-table__cell.is-leaf {
      border-bottom: none;
    }
    .el-table__body {
      .el-table__cell {
        padding: 20px 0;
      }
    }
  }
  /deep/.el-checkbox__input {
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    background-color: #fff;
    border-color: 1px solid #dcdfe6;
    .el-checkbox__inner {
      box-sizing: border-box;
      text-align: center;
      width: 14px;
      height: 14px;
      line-height: 14px;
      font-size: 14px;
      border-radius: 2px;
      background-color: #fff;
      border-color: #dcdfe6;
    }
    .el-checkbox__inner:hover {
      border-color: @theme-color;
    }
  }
  /deep/.el-checkbox__input:hover {
    border-color: @theme-color;
  }
  /deep/.el-checkbox__input.is-checked,
  /deep/.el-checkbox__input.is-indeterminate {
    width: 14px;
    height: 14px;
    line-height: 14px;
    border-radius: 2px;
    background-color: @theme-color;
    border-color: @theme-color;
    // font-size: 14px;
    .el-checkbox__inner {
      background-color: @theme-color;
      border-color: @theme-color;
    }
  }
  // /deep/.el-checkbox .el-checkbox__input.is-focus{
  //   background-color: #fff;
  //   border-color: #DCDFE6;
  //   .el-checkbox__inner{
  //     // background-color: #fff;
  //     // border-color: #DCDFE6;
  //   }
  // }
  .shopcar-page {
    .page-title {
      padding: 0 24px;
      padding-top: 20px;
      padding-bottom: 11px;
      .text {
        margin-top: 20px;
        padding-bottom: 8px;
        font-weight: 500;
        font-size: 22px;
        color: @font-color-14;
        border-bottom: @border-1-fo;
        .batch {
          font-weight: 400;
          font-size: 16px;
          color: @font-color-66;
          cursor: pointer;
        }
      }
    }
    .list {
      margin-top: 8px;
      .item-box {
        display: none;
      }
      .table {
        display: block;
        .goods {
          .img {
            width: 56px;
            height: 56px;
            border-radius: 7px;
            cursor: pointer;
          }
          .info {
            margin-left: 12px;
            flex: 1;
            .name {
              width: 200px;
              font-weight: 500;
              font-size: 14px;
              color: @font-color-26;
            }
            .desc {
              width: 200px;
              margin-top: 4px;
              font-size: 12px;
              color: @font-color-66;
            }
          }
        }
        .num-box {
          //margin-right: 13px;
        }
        .price {
          font-family: HelveticaNeue, HelveticaNeue;
          font-weight: 500;
          font-size: 14px;
          color: @font-color-26;
        }
        .total-price {
          font-family: HelveticaNeue, HelveticaNeue;
          font-weight: bold;
          font-size: 14px;
          color: @theme-color;
        }
        .delete-btn {
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 14px;
          color: @font-color-66;
        }
        .disabled {
          font-size: 14px;
          color: #b3b3b3;
        }
      }
      .total {
        margin-top: 24px;
        padding: 24px 20px;
        .all-select {
          display: none;
        }
        .text {
          .label {
            font-weight: 500;
            font-size: 20px;
            color: @font-color-14;
          }
          .money {
            font-family: Helvetica, Helvetica;
            font-weight: bold;
            font-size: 24px;
            color: @theme-color;
          }
        }
        .theme-btn {
          margin-left: 40px;
          padding: 0 20px;
          width: auto;
          height: 50px;
          line-height: 50px;
        }
        .theme-plain-btn {
          margin-left: 40px;
          padding: 0 20px;
          width: auto;
          height: 50px;
          line-height: 50px;
        }
      }
    }
  }
  @media screen and (max-width: 992px) and (min-width: 768px) {
    .confirm-dialog {
      /deep/ .el-dialog {
        width: 377px !important;
      }
      .handle {
        .btn {
          font-size: 14px;
          width: 155px;
          height: 40px;
          line-height: 40px;
        }
        .cancle-btn {
          color: @font-color-99;
        }
        .delete-btn {
          color: #ffffff;
          border-color: @theme-color;
          background: @theme-color;
        }
      }
    }
    .shopcar-page {
      .page-title {
        padding: 0 16px;
        padding-top: 16px;
        padding-bottom: 8px;
        .text {
          margin-top: 0px;
          padding-bottom: 8px;
          font-weight: 500;
          font-size: 20px;
          color: @font-color-14;
          border-bottom: @border-1-e5;
          .batch {
            font-weight: 500;
            font-size: 14px;
            color: #b3b3b3;
            cursor: pointer;
          }
        }
      }
      .list {
        margin-top: 8px;
        padding: 0 16px;
        .table {
          display: none;
        }
        .item-box {
          display: block;
          .list-itemss {
            position: relative;
            box-sizing: border-box;
            width: 100%;
            padding: 16px 0;
          }
          /deep/.el-checkbox {
            width: 16px;
            height: 16px;
            border-radius: 8px;
          }
          .goods {
            margin-left: 12px;
            .img {
              width: 60px;
              height: 60px;
              border-radius: 8px;
              cursor: pointer;
            }
            .info {
              margin-left: 12px;
              .name {
                width: 240px;
                font-weight: 500;
                font-size: 14px;
                color: @font-color-26;
              }
              .desc {
                width: 240px;
                margin-top: 4px;
                font-size: 11px;
                color: @font-color-99;
              }
              .price {
                margin-top: 8px;
                font-family: HelveticaNeue, HelveticaNeue;
                font-weight: bold;
                font-size: 14px;
                color: @theme-color;
              }
              .disabled {
                margin-top: 12px;
                font-weight: 500;
                font-size: 12px;
                color: @font-color-99;
              }
            }
          }
          .num-box {
            position: absolute;
            right: 16px;
            bottom: 12px;
            margin-right: 0px;
          }
        }
        .total {
          justify-content: space-between;
          position: fixed;
          left: 50%;
          bottom: 0;
          width: 768px;
          margin-top: 0;
          padding: 20px 16px 54px 16px;
          background: @color-ff;
          box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
          transform: translateX(-50%);
          .all-select {
            display: block;
            /deep/.el-checkbox__label {
              font-size: 12px;
              color: @font-color-66;
            }
            /deep/.el-checkbox__input.is-checked {
              .el-checkbox__label {
                font-size: 12px;
                color: @font-color-66;
              }
            }
          }
          .text {
            .label {
              margin-left: 8px;
              font-weight: 500;
              font-size: 12px;
              color: @font-color-14;
            }
            .money {
              font-family: HelveticaNeue, HelveticaNeue;
              font-weight: 500;
              font-size: 20px;
              color: @theme-color;
            }
          }
          .theme-btn {
            margin-left: 0px;
            padding: 0 15px;
            width: auto;
            height: 40px;
            line-height: 40px;
            border-radius: 24px;
            font-weight: 500;
            font-size: 14px;
          }
          .theme-plain-btn {
            margin-left: 0px;
            padding: 0 15px;
            width: auto;
            height: 40px;
            line-height: 40px;
            font-size: 14px;
          }
        }
      }
    }
  }
  @media screen and (max-width: 767px) {
    .confirm-dialog {
      /deep/ .el-dialog {
        width: 277px !important;
      }
      .handle {
        .btn {
          font-size: 14px;
          width: 155px;
          height: 40px;
          line-height: 40px;
        }
        .cancle-btn {
          color: @font-color-99;
        }
        .delete-btn {
          color: #ffffff;
          border-color: @theme-color;
          background: @theme-color;
        }
      }
    }
    .shopcar-page {
      .page-title {
        padding: 0 16px;
        padding-top: 16px;
        padding-bottom: 8px;
        .text {
          margin-top: 0px;
          padding-bottom: 8px;
          font-weight: 500;
          font-size: 20px;
          color: @font-color-14;
          border-bottom: @border-1-e5;
          .batch {
            font-weight: 500;
            font-size: 14px;
            color: #b3b3b3;
            cursor: pointer;
          }
        }
      }
      .list {
        margin-top: 8px;
        padding: 0 16px;
        .table {
          display: none;
        }
        .item-box {
          display: block;
          .list-itemss {
            position: relative;
            box-sizing: border-box;
            width: 100%;
            padding: 16px 0;
          }
          /deep/.el-checkbox {
            width: 16px;
            height: 16px;
            border-radius: 8px;
          }
          .goods {
            margin-left: 12px;
            .img {
              width: 60px;
              height: 60px;
              border-radius: 8px;
              cursor: pointer;
            }
            .info {
              margin-left: 12px;
              .name {
                width: 240px;
                font-weight: 500;
                font-size: 14px;
                color: @font-color-26;
              }
              .desc {
                width: 240px;
                margin-top: 4px;
                font-size: 11px;
                color: @font-color-99;
              }
              .price {
                margin-top: 8px;
                font-family: HelveticaNeue, HelveticaNeue;
                font-weight: bold;
                font-size: 14px;
                color: @theme-color;
              }
              .disabled {
                margin-top: 12px;
                font-weight: 500;
                font-size: 12px;
                color: @font-color-99;
              }
            }
          }
          .num-box {
            position: absolute;
            right: 16px;
            bottom: 12px;
            margin-right: 0px;
          }
        }
        .total {
          justify-content: space-between;
          position: fixed;
          left: 50%;
          bottom: 0;
          width: 100%;
          margin-top: 0;
          // padding: 20px 16px 54px 16px;
          background: @color-ff;
          box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
          transform: translateX(-50%);
          .all-select {
            display: block;
            /deep/.el-checkbox__label {
              font-size: 12px;
              color: @font-color-66;
            }
            /deep/.el-checkbox__input.is-checked {
              .el-checkbox__label {
                font-size: 12px;
                color: @font-color-66;
              }
            }
          }
          .text {
            .label {
              margin-left: 8px;
              font-weight: 500;
              font-size: 12px;
              color: @font-color-14;
            }
            .money {
              font-family: HelveticaNeue, HelveticaNeue;
              font-weight: 500;
              font-size: 20px;
              color: @theme-color;
            }
          }
          .theme-btn {
            margin-left: 0px;
            // padding: 0 10px;
            width: auto;
            height: 40px;
            line-height: 40px;
            border-radius: 24px;
            font-weight: 500;
            font-size: 14px;
          }
          .theme-plain-btn {
            margin-left: 0px;
            // padding: 0 10px;
            width: auto;
            height: 40px;
            line-height: 40px;
            font-size: 14px;
          }
        }
      }
    }
  }
</style>
